package com.eden.controller;


import com.eden.common.R;
import com.eden.service.CategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("categorys")
public class CategoryController {

    @Autowired
    private CategoryService categoryService;

    @GetMapping
    public R listCategory() {
        return categoryService.findAll();
    }

    @GetMapping("detail")
    public R categoriesDetail(){
        return categoryService.findAllDetail();
    }


}

